﻿@using CP_SchoolForChildren_v0._1.Controllers.Support
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>@ViewBag.Title</title>
        <link href="@Url.Content("~/Content/FE/style.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/FE/IndexEffect/EffectIndex.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/FE/style/style.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/FE/style/SchoolStyle.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Content/BE/jts/themes/base/jquery-ui.css")" rel="stylesheet"
            type="text/css" />
        <script src="@Url.Content("~/Scripts/FE/jquery-1.8.2.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/FE/jquery-ui-1.9.0.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/FE/jquery.horizontalNav.js")" type="text/javascript"> </script>
    </head>
    <body>
        <!-- user bar start -->
        <div id="userbar">
            <div style="float: right; width: 50%">
                @if (!User.Identity.IsAuthenticated)
                {
                    <!-- Form đăng nhập -->

                    <form class="form-2" method="POST" action="@Url.Action("LogOn", "Account")">
                        <input type="text" name="username" placeholder="Tên đăng nhập">
                        <input type="password" name="password" placeholder="Mật khẩu"> 
                        
                        <label style="color: white; float: left; padding-top: 10px;">
                            <input type='checkbox' value="true" style="float: left" id='RememberMe' name="RememberMe">Ghi nhớ?
                        </label>
                        <input type="submit" name="submit" value="Đăng nhập">
                        <a class="regislink" href="@Url.Action("Register", "Account")" style="float: left;">Đăng ký</a>
                    </form>


                    <!-- hết form đăng nhập -->
                }
                else
                {
                    var fc = new FunctionController();
                    var userId = fc.CurrentUserID(User.Identity.Name);

                    <ol class="userlink" style="float: right;">
                        <li><span style="color: white; font-weight: bold">Xin chào, </span></li>
                        <li><a href="@Url.Action("ViewUserProfile", "User", new {id = userId})">@User.Identity.Name,</a></li>
                        @if (@User.IsInRole("Admin"))
                        {
                            <li>@Html.ActionLink("Quản lý hệ thống", "Index", "SchoolManagement")</li>
                            <li>@Html.ActionLink("Quản lý bài viết", "Index", "Article")</li>
                        }
                        else if (@User.IsInRole("Editor"))
                        {
                            <li>@Html.ActionLink("Quản lý bài viết", "Index", "Article")</li>
                        }
                        <li>@Html.ActionLink("Thoát", "LogOff", "Account")</li>
                    </ol>
                }
            </div>
           
        </div>
        <!-- user bar end -->
        <div class="allpage">
            <!--header start -->
            <div id="header">
            </div>
            <div id="topnav">
                <script type="text/javascript">
                    $(document).ready(function () {

                        //On Click Event
                        $(".top-nav li").click(function () {
                            //alert('fuck year');
                            //$("ul.horizontal-nav li").removeClass("top-nav-active"); //Remove any "active" class
                            $(this).addClass("top-nav-active"); //Add "active" class to selected tab

                        });

                    });
                </script>
                <nav class="horizontal-nav full-width horizontalNav-notprocessed">
                    <ul style="display: table; float: none; width: 100%;">
                        <li class="top-nav-active">@Html.ActionLink("Trang chủ", "Index", "Home")</li>
                        <li>@Html.ActionLink("Admincp", "Index", "SchoolManagement")</li>
                        <li>@Html.ActionLink("Hỏi đáp mỗi ngày", "Index", "QA")</li>
                        <li>@Html.ActionLink("Tin tức sự kiện", "Index", "Article")</li>
                        <li>@Html.ActionLink("Trợ giúp", "Help", "Home")</li>
                        <li>@Html.ActionLink("Liên hệ", "Contact", "Home")</li>
                    </ul>
                </nav>
                <script>
                    $(document).ready(function () {
                        // Call horizontalNav on the navigations wrapping element
                        $('.full-width').horizontalNav({});
                    });
                </script>
            </div>
            <!-- br class="clearfix"/ --    >
            <!--header end -->
            <!--body start -->
            <div id="body">
                @RenderSection("Result", false)
                @RenderBody()
                <br class="spacer" />
            </div>
            <!--body end -->
        </div>
        <!--footer start -->
        <div style="padding-bottom: 10px;" class="bottompage"></div>
        <div id="footer">
            <div style="margin: auto; width: 500px;">
                <ul >
                    <li>@Html.ActionLink("Trang chủ", "Index", "Home")</li>
                    <li>@Html.ActionLink("Tìm trường cho bé", "Index", "SchoolManagement")</li>
                    <li>@Html.ActionLink("Hỏi đáp mỗi ngày", "Index", "QA")</li>
                    <li>@Html.ActionLink("Tin tức sự kiện", "Index", "Article")</li>
                    <li>@Html.ActionLink("Trợ giúp", "Help", "Home")</li>
                    <li>@Html.ActionLink("Liên hệ", "Contact", "Home")</li>
                </ul>
            </div>
        </div>

        <!--footer end -->
    </body>
</html>